/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beanInfo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author VANTRUY
 */
@Entity
@Table(name = "TourPack")
@NamedQueries({
    @NamedQuery(name = "TourPack.findAll", query = "SELECT t FROM TourPack t"),
    @NamedQuery(name = "TourPack.findByTourID", query = "SELECT t FROM TourPack t WHERE t.tourID = :tourID"),
    @NamedQuery(name = "TourPack.findByTourName", query = "SELECT t FROM TourPack t WHERE t.tourName = :tourName"),
    @NamedQuery(name = "TourPack.findByIntro", query = "SELECT t FROM TourPack t WHERE t.intro = :intro"),
    @NamedQuery(name = "TourPack.findByImageurl", query = "SELECT t FROM TourPack t WHERE t.imageurl = :imageurl"),
    @NamedQuery(name = "TourPack.findByIsallowed", query = "SELECT t FROM TourPack t WHERE t.isallowed = :isallowed")})
public class TourPack implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "tourID")
    private Integer tourID;
    @Column(name = "tourName")
    private String tourName;
    @Column(name = "intro")
    private String intro;
    @Column(name = "imageurl")
    private String imageurl;
    @Column(name = "isallowed")
    private Boolean isallowed;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tourPack")
    private List<TourSchedule> tourScheduleList;
    @JoinColumn(name = "placedest", referencedColumnName = "cityID")
    @ManyToOne
    private City city;
    @JoinColumn(name = "placestart", referencedColumnName = "cityID")
    @ManyToOne
    private City city1;

    public TourPack() {
    }

    public TourPack(Integer tourID) {
        this.tourID = tourID;
    }

    public Integer getTourID() {
        return tourID;
    }

    public void setTourID(Integer tourID) {
        this.tourID = tourID;
    }

    public String getTourName() {
        return tourName;
    }

    public void setTourName(String tourName) {
        this.tourName = tourName;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public String getImageurl() {
        return imageurl;
    }

    public void setImageurl(String imageurl) {
        this.imageurl = imageurl;
    }

    public Boolean getIsallowed() {
        return isallowed;
    }

    public void setIsallowed(Boolean isallowed) {
        this.isallowed = isallowed;
    }

    public List<TourSchedule> getTourScheduleList() {
        return tourScheduleList;
    }

    public void setTourScheduleList(List<TourSchedule> tourScheduleList) {
        this.tourScheduleList = tourScheduleList;
    }

    public City getCity() {
        return city;
    }

    public void setCity(City city) {
        this.city = city;
    }

    public City getCity1() {
        return city1;
    }

    public void setCity1(City city1) {
        this.city1 = city1;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tourID != null ? tourID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TourPack)) {
            return false;
        }
        TourPack other = (TourPack) object;
        if ((this.tourID == null && other.tourID != null) || (this.tourID != null && !this.tourID.equals(other.tourID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "beanInfo.TourPack[tourID=" + tourID + "]";
    }

}
